package net.openl10n.mdf;

import java.util.List;

import net.openl10n.document.api.IFragment;
import net.openl10n.document.api.IFragmentContainer;

import com.google.common.collect.ImmutableList;

public class ContainerFragment implements IFragment, IFragmentContainer{

	private final ImmutableList<IFragment> fragments;
	
	public ContainerFragment(List<IFragment> fragments) {
		if(fragments == null)
			throw new IllegalArgumentException("fragments cannot be null");
		this.fragments = ImmutableList.copyOf(fragments);
	}
	
	@Override
	public final ImmutableList<IFragment> getFragments() {
		return fragments;
	}
}
